<%--
 *  File:    ControlGLAccountMasterEdit.jsp
 *  @Author: Stephen Liu
 *  Date:    Monday, January 19, 2004

 *  Copyright (C) 2000 - 2001 Oval Technologies, Inc.
 *  All rights reserved.
 *
 *  This software is the confidential and proprietary information of Oval
 *  Technologies, Inc. ("Confidential Information").  You shall not
 *  disclose such Confidential Information and shall use it only in
 *  accordance with the terms of the license agreement you entered into
 *  with Oval.
--%>

<%@ page language="java" %>
<%@ page import="java.util.*" %>
<%@ page import="org.apache.log4j.Category" %>
<%@ page import="com.oval.util.*" %>

<%@ page contentType ="text/html;charset=UTF-8" %>
<%@ taglib uri="/WEB-INF/PageFlow.tld" prefix="PageFlow" %>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
<%@ taglib uri="/WEB-INF/custom.tld" prefix="custom" %>

<%
  Category cat = Category.getInstance("jsp.ControlGLAccountMasterEdit");
  String strModuleName = "GL";
  String privilegeCode = "40109";
%>

<%@ include file="/inc/PageDefault.inc" %>
<%@ include file="/inc/SessionTimeout.inc" %>
<%@ include file="/inc/Security.inc" %>
<iframe name="reloadHandler" style="display:none" ></iframe>

<html>
<head>
<title>controlglaccountmasteredit</title>
<PageFlow:CheckPageFlow pageName="controlglaccountmasteredit"/>
<%
  HashMap glaccountinfo = (HashMap) pageContext.getAttribute("glaccountinfo");
  if (glaccountinfo == null)
    glaccountinfo = new HashMap();

  if (glaccountinfo.get("entitytype") != null && glaccountinfo.get("entitytype").toString().equals("1"))
    pageContext.setAttribute("glaccountlistid", glaccountinfo.get("entityid"));

  String strBooksetType="1";
%>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" href="../css/<%= strLanguageCode %>/main.css" type="text/css">
<script language="JavaScript" src="../css/<%= strLanguageCode %>/script.js"></script>
<script language="JavaScript" src="../js/ScriptLib.js"></script>
<script language="JavaScript">

<% if (request.getParameter("hassaved") != null) { %>
  parent.up.location.href = "ControlGLAccountEditHeader.jsp?<%= OvalTools.randomURL() %>&booksettype="+parent.up.document.all.frm.booksettype.value+"&glaccountid=<custom:write name="glaccountinfo" property="glaccountid"/>";
<% } %>

function page_save() {
  if (!checkForm(frm))
    return;
  MLCSTransform(frm);

  frm.actionname.value = "save";
  isRunning = true;
  frm.submit();
}

function page_setGLAccount(glaccountid,accountname,accountcode,quickcode,grade,statusname,foreflag,isbottom,classcode,adjustflag,currencycode,currencytype,forecurrencycode,copflag)
{
  frm.targetglaccountid.value=glaccountid;
  frm.targetaccountcode.value=accountcode;
  frm.targetaccountname.value=accountname;
}

function page_reloadglac()
{
  if (frm.targetaccountcode.value==""){
    frm.targetglaccountid.value="";
    frm.targetaccountname.value="";
    return;
    }
 frm.targetglaccountid.value="";
 frm.targetaccountname.value="";
 page_handleRequest('<%=JspHelper.filterNull(request.getContextPath())%>',frm);
}

function page_handleResponse()
{

    frm.targetglaccountid.value = getResponseData("glaccountid");
    frm.targetaccountname.value = getResponseData("accountname");
}

function page_initpage()
{
    if(parent.up.document.all.frm.booksettype.value!='3')
    {
       document.all("glaccountmap") .style.display="none";
    }
}

</script>
</head>
<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" onload="javascript:set_contentleft_height1(420);page_initpage();">
<form name="frm" method="post" action="../Dispatcher">
  <input type="hidden" name="pagename" value="controlglaccountmasteredit">
  <input type="hidden" name="actionname">
  <input type="hidden" name="schema" value="ovglaccount">
  <input type="hidden" name="qlname" value="selectglaccountforreload">
<input type="hidden" name="removevalues" value="">

  <custom:hidden property="glaccountid"/>
  <custom:hidden property="glaccountlistid"/>

  <input type="hidden" name="numrows" value="2">

<table id="topTable" border=0 cellpadding=0 cellspacing=0 width="100%">
  <tr>
    <td valign=top>
      <table border=0 cellpadding=1 cellspacing=0 width="100%">
        <tbody>
          <tr>
           <td bgcolor=#000000 style="PADDING-BOTTOM: 1px; PADDING-LEFT: 1px; PADDING-RIGHT: 1px; PADDING-TOP: 0px">
              <table bgcolor=#000000 border=0 cellpadding=0 cellspacing=0 width="100%">
                <tr>
                  <td bgcolor=#ffffff style="PADDING-BOTTOM: 3px; PADDING-LEFT: 3px; PADDING-RIGHT: 3px; PADDING-TOP: 3px">
                   <div id=div2 style="HEIGHT: 245px; OVERFLOW: auto">
                      <table border="1" cellspacing="0" bordercolorlight="#999999" bordercolordark="#FFFFFF" align="center" width="100%" cellpadding="1">
                        <tr>
                          <td colspan="4" class="td_right">
                            <a onclick="javascript:page_save()"><custom:button type="2" label="L_Save" border="0"/></a>
                          </td>
                        </tr>
                        <tr>
                          <td width="107" class="td-text" height="20"><%= label.getLabelName("L_GLAccountCode") %><%= label.getLabelName("L_Colon") %></td>
                          <td width="300">
                            <custom:write name="glaccountinfo" property="accountcode"/>
                          </td>
                          <td class="td-text" width="110" ><%= label.getLabelName("L_QuickCode") %><%= label.getLabelName("L_Colon") %></td>
                          <td>
                            <custom:text name="glaccountinfo" property="quickcode" size="25"/>
                          </td>
                        </tr>
                        <tr>
                          <td class="td-text" ><%= label.getLabelName("L_GLAccountName") %><%= label.getLabelName("L_Colon") %></td>
                          <td height="18" colspan="3">
                            <custom:text name="glaccountinfo" property="accountname" size="75" needMLC="true" isFirstMLC="true" multiLangType="accountname" entityId="glaccountid" contentId="glaccountlangid" colIndex="0"/>
                            <a onclick='popup("../common/Lang.jsp?<%= OvalTools.randomURL() %>&form=frm&module=GL&mlctype=L_GLAccountName&nativelanguage=&schema=ovglaccountlang&qlname=selectbyid&entityid=<custom:write name="glaccountinfo" property="glaccountid"/>&entitytype=accountname&contentid=glaccountlangid&colindex=0","newwindow","height=250,width=320,top=100,left=100,toolbar=no,menubar=no,scrollbars=no,resizable=no,location=no,status=no");'><custom:button type="3" label="L_Ln" imgsrc="ln.gif" border="0"/></a>
                          </td>
                        </tr>

                        <tr id="glaccountmap">
                          <td width="107" class="td-text" height="20"><%= label.getLabelName("L_FinanceGlaccount") %><%= label.getLabelName("L_Colon") %></td>
                          <td width="300">
                            <custom:text name="glaccountmap" property="targetaccountcode" onchange="page_reloadglac()" size="10"/>
                            <a onclick='window.open("GLADebit.jsp?<%= OvalTools.randomURL() %>&orgid=<custom:write name="userinfo" property="orgid" scope="session"/>&needall=N", "newwindow", "height=400, width=600,top=50,left=50,toolbar=n0, menubar=no, scrollbars=yes, resizable=no, location=no, status=no")'>
                            <custom:button type="3" label="L_Asterisk" imgsrc="flash.gif" border="0"/></a>
                            <custom:text name="glaccountmap" property="targetaccountname"  readonly="true" size="20"/>
                            <custom:hidden name="glaccountmap" property="targetglaccountid" />
                            <custom:hidden name="glaccountmap" property="glaccountmapid" />
                          </td>
                          <td class="td-text" >&nbsp</td>
                          <td>&nbsp</td>
                        </tr>

                        <tr>
                          <td class="td-text" height="20"><%= label.getLabelName("L_CreateDate") %><%= label.getLabelName("L_Colon") %></td>
                          <td>
                            <custom:write name="glaccountinfo" property="createdate" dataFormatName="dateformat"/>
                          </td>
                          <td class="td-text" ><%= label.getLabelName("L_Datelastupdate") %><%= label.getLabelName("L_Colon") %></td>
                          <td>
                            <custom:write name="glaccountinfo" property="datelastupdated" dataFormatName="dateformat"/>
                          </td>
                        </tr>
                        <tr>
                          <td class="td-text" height="20"><%= label.getLabelName("L_RptDescription") %><%= label.getLabelName("L_Colon") %></td>
                          <td colspan="3" valign="top">
                            <custom:textarea name="glaccountinfo" property="description" cols="75" rows="4" needMLC="true" isFirstMLC="true" multiLangType="description" entityId="glaccountid" contentId="glaccountlangid" colIndex="0"/>
                            <a onclick='popup("../common/Lang.jsp?<%= OvalTools.randomURL() %>&form=frm&module=GL&mlctype=L_Description&nativelanguage=&schema=ovglaccountlang&qlname=selectbyid&entityid=<custom:write name="glaccountinfo" property="glaccountid"/>&entitytype=description&contentid=glaccountlangid&colindex=0","newwindow","height=250,width=320,top=100,left=100,toolbar=no,menubar=no,scrollbars=no,resizable=no,location=no,status=no");'><custom:button type="3" label="L_Ln" imgsrc="ln.gif" border="0"/></a>
                          </td>
                        </tr>
                      </table>
                    </div>
                  </td>
                </tr>
              </table>
            </td>
          </tr>
        </tbody>
      </table>
    </td>
  </tr>
  <tr>
    <td class=summary_top></td>
  </tr>
  <tr>
    <%@ include file="ControlGLAccountEditBtn.inc" %>
  </tr>
</table>
</form>
</body>
</html>
